/**
 *用户服务
 */
interface IAccountCycleService {
    /**
     * 编辑用户
     * v1.0
     * @param id 用户编号
     * @param password 密码
     * @param rePassword 重复密码
     * @param email 邮箱
     * @param phoneNumber 手机号
     * @param isEnabled 是否启用
     * @param userGroupId 用户组编号
     * @param roles 权限数组
     */
    saveEnterpriseCycle(id: string, accountCycle : string, accountCycleUnit : string, backMoneyCycle : string, backMoneyCycleUnit : string): ng.IHttpPromise<BaseResponse>;
}


class accountCycleService implements IAccountCycleService {
    constructor(private http: ng.IHttpService, private route: routeService) {
    }

    saveEnterpriseCycle(id: string, accountCycle : string, accountCycleUnit : string, backMoneyCycle : string, backMoneyCycleUnit : string): ng.IHttpPromise<BaseResponse> {
        return this.http<BaseResponse>({
            method: "PUT",
            url: this.route.getUrl("client/EnterpriseCycle/{{id}}", {
                id: id
            }),
            data: {
                accountCycle: accountCycle,
                accountCycleUnit: accountCycleUnit,
                backMoneyCycle: backMoneyCycle,
                backMoneyCycleUnit: backMoneyCycleUnit
            }
        });
    }


}
angular.module("accountCycleService",[]).service("accountCycleService",['$http','routeService',accountCycleService]);